<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        const username = ['张三', { uname: '张三', age: 18, address: '杭州' }, { uname: '李四', age: 20, address: '上海' }]
        // console.log();
        let [a, ...arr] = username
        console.log(a)
        console.log(arr);
        // if()
        for (let i = 0; i < arr.length; i++) {
            if (arr[i].uname === a) {
                console.log(arr[i]);
            }
        }
    </script>
</body>

</html>